{
 "cells": [
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 本项目用于学习numpy相关api\n",
    "学习的参考地址为：[https://numpy.org/doc/stable/user/absolute_beginners.html]"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## numpy简介\n",
    "Numpy 是一个开源的python代码库，被广泛应用到科学和工程领域。是python针对于数字的通用标准库。被广泛应用到很多框架，如Pandas，Scipy，Matplotlib，scikit-learn，scikit-image等相关的数据科学库。\n",
    "\n",
    "## numpy的安装\n",
    "```\n",
    "conda install numpy\n",
    "```\n",
    "\n",
    "```\n",
    "pip install numpy\n",
    "```\n",
    "\n",
    "\n",
    "## 如何引用numpy\n",
    "\n",
    "```python\n",
    "import numpy as np\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## python默认的list和numpy的array有什么区别？\n",
    "numpy给我们提供了一个快速高效创建array的方式,并且可以操纵这些数据。\n",
    "在列表中的数据元素可以不完全都属于同一类型，而在numpy中array中的数据类型都属于同一类。\n",
    "\n",
    "### 为什么用Numpy\n",
    "1. numpy array 比python的list更快更紧凑。\n",
    "2. numpy 使用更少的内存同时提供更便捷的使用方式。\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "([1, 2, 3, '1111', {'a': 'a', 'n': 1}, 12], array([1.  , 2.  , 3.14]))"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a = [1,2,3,'1111',{'a':'a','n':1},12]\n",
    "\n",
    "\n",
    "\n",
    "na = np.array([1,2,3.14])\n",
    "a,na\n"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 什么是array？\n",
    "array是一个数据网格,包含了原始数据的相关信息，以及如何去定位一个元素，如何去解析一个元素。有多种方式实现元素的定位。array中的元素类型都是一样的，被称为dtype。\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "yolov7",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.16"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
